import java.util.Arrays;

/**
 * @ClassName LC169
 * @Author ykx
 * @Date 2024/6/23 17:12
 * @Version 1.0
 */
public class LC169 {
    public static void main(String[] args) {
        LC169 lc169 = new LC169();
        System.out.println(lc169.majorityElement(new int[]{2, 2, 1, 1, 1, 2, 2}));
    }

    public int majorityElement(int[] nums) {
        Arrays.sort(nums);
        return nums[nums.length / 2];
    }

}
